//
//  CGWService+ChannelProocol.m
//  etionCBLogic
//
//  Created by wjxfhxy on 15-4-10.
//  Copyright (c) 2015年 GuangZhouXuanWu. All rights reserved.
//

#import "CGWService+ChannelProocol.h"

#import "ProtocolBase.h"

@implementation CGWService (ChannelProocol)

-(XLGResult*)sendChannelProtocol:(CProtocolBase *(^)())channelProtocol
{
    XLGResult *result = nil;
    
    CProtocolBase *protocol = channelProtocol();
    
    if(protocol != nil)
        result = [self sendProtocol:protocol];
    else
        result = [XLGResult resultWithOutResult:NO outObj:nil outError:nil];

    return result;
}

- (XLGResult*)longConnectSendChannelProtocol:(CProtocolBase*(^)())channelProtocol
{
    XLGResult *result = nil;
    
    CProtocolBase *protocol = channelProtocol();
    
    if(protocol != nil)
        result = [self longConnectSendProtocol:protocol];
    else
        result = [XLGResult resultWithOutResult:NO outObj:nil outError:nil];
    
    return result;
}

@end
